home *** CD-ROM | disk | FTP | other *** search
- COMBI-Disk -
- RAM disk & disk cache
-
-
- Preface.
- --------
-
- - Why don't You use disk cache?
- - I'd like, but memory constrains prevent me from using it:
- I need more memory for RAM disk.
- -----
- - Why don't You use RAM disk?
- - I'd like, but memory constrains prevent me from using it:
- I need more memory for disk cache.
- -----
- - Why don't You use RAM disk or disk cache?
- - I'd like, but some of my applications require free extended
- memory.
-
- If one of these answers is Yours then COMBI-Disk is for You!
- You may hit THREE targets with a single shot - installing COMBI-Disk
- You get a RAM disk and a Disk-Cache and free XMS memory at the same
- time in the SAME area of extended memory!
-
- When You install COMBI-Disk You specify amount of extended memory for
- it and You get a RAM disk of the specified size and a Disk-Cache of the
- same size. You may also specify amount of memory which should be
- released if some program requires it. Then when You work with Your PC,
- You enjoy COMBI's disk cache which is not worse than others (I hope it
- is better). Suppose now that You start a program which needs a disk
- buffer for temporary storage and tell it to use RAM disk. Then the
- program may use the whole amount of the RAM disk's space (though
- contracting the size of cache). When it terminates and deletes
- temporary files You get back your cache buffer! If a program requests
- XMS memory COMBI-disk may loan some of its memory to the program (if it
- has the requested amount free of RAM disk data). When the program
- releases the memory COMBI-disk reallocates it back.
-
-
- Applications.
- ------------
-
- Some programs (e.g. compilers, word-processors etc.) need a buffer for
- temporary storage, and if the storage is RAM disk then their performance
- may be increased few times compared with the case of usage of hard disk
- instead. That's why You may sometimes need a RAM disk. But if You use
- standard RAM disk (Microsoft (C) RAMDRIVE.SYS or IBM (C) VDISK.SYS or any
- other) it often comes out that it stays empty most of the time though
- consuming Your extended (expanded) memory. That's why You may wish to
- give up using RAM disk or make it less in order to have more memory
- for disk cache which is always useful.
-
- Moreover, some of programs can take advantage of XMS memory if it is
- available. That's why You may wish to give up using disk cache (though
- some of caches support memory reallocation without reinstallation).
-
- Don't get disappointed!
- COMBI-Disk
- is a nice solution of this problem! It uses a little more memory for
- RAM disk than is needed to keep all files written into it while all the
- remaining memory is used for cache. You need not bother to make this
- memory larger - just WRITE Your file(s) into RAM disk, all the rest it
- does itself! You need not bother as well to contract RAM disk's size
- and increase cache size - just DELETE files from RAM disk and all the
- released memory will be used for cache! You need not bother to
- reconfigure Your system when You need some free XMS memory - COMBI-disk
- takes care of that itself (however, if You forgot to specify amount of
- memory COMBI-disk would release, You have to run COMBI control program
- to tell COMBI-disk that You need certain amount of free XMS memory).
-
-
- System requirements.
- -------------------
-
- 1. 80x86 based machine with extended memory.
- 2. DOS 3.30+.
- 3. Extended memory manager which supports XMS 2.0 specifications
- which supports "reallocate XMS" function (Microsoft (C) HIMEM.SYS
- ver 2.77+ or Quarterdeck (C) QEMM.SYS will do, as well as most
- others).
-
-
- General features.
- ----------------
-
- - COMBI-disk may use up to 16 Mbytes of extended (XMS) memory.
- - Up to 8 physical hard disks are supported.
- - Starting from version 1.00 background write caching is
- supported.
- - Automatic reallocation of XMS memory.
- - Variable size of cache block (memory allocation unit) -
- from 1 to 8 disk sectors (512 bytes each).
- - IOCtl interface to control program.
- - HMA may be used for COMBI-disk data tables (even when MS-DOS
- 5.0 is loaded into HMA and under DR-DOS 6.0 as well).
-
-
- Installation.
- ------------
-
- Warning! It is recommended to make backup of hard disk before
- installation of COMBI-disk (as well as any other disk cache program).
-
- COMBI-Disk installation process is quite straightforward, although it
- requires some tweaking with the contents of your CONFIG.SYS file. Copy
- COMBI.SYS into Your hard-disk and insert the following line into Your
- CONFIG.SYS file
-
- DEVICE=[drive:][path]COMBI.SYS [<parameters>]
-
- The proper place in CONFIG.SYS would be after all memory managers,
- after disk managers and if possible before disk write-protection
- programs (otherwise You should not turn on write caching).
-
- The <parameters> are all optional and include:
-
- [<buff_size> [<rls_size>]] [/V [<RAMd_parms>]] [/C [<cache_parms]] [/H] [/Q]
-
-
-
- <buff_size> - the amount of XMS memory (Kbytes) You want to use for
- COMBI-Disk. Minimum is 128K, maximum is about 14000K.
- If it is omitted then all available memory is default.
- There is no harm if You specify more memory than really is
- available - then COMBI-disk uses all available memory.
-
- <rls_size> - maximum number of XMS memory (Kbytes) COMBI-disk should
- release when it is requested. Default is 0. Note, if You
- want to specify this number You should also specify
- <buff_size>.
-
- /V - means that RAM disk parameters follow.
-
- <RAMd_parms> - RAM disk parameters may be the following:
-
- F:<disk_size>- specifies formatted size of RAM disk. By default COMBI
- creates RAM disk of the size (<buff_size> - <rls_size> -
- - <min_cache>) Kbytes, so that there would never arise
- problem that there is not enough free XMS memory to
- allocate for RAM disk. But You may (and I recommend You)
- specify larger size: up to (<buff_size> - <min_cache>) -
- that gives You maximum flexibility though sometimes may
- cause errors if the same program that borrowed XMS from
- COMBI tries to write a lot to RAM disk.
-
- R:<root_num> - number of entries in root directory of RAM disk. Default
- is 64. If You encounter DOS error "can't create file..."
- when number of file in root directory is 63 (plus one
- for volume label) then try specifying, say, R:128.
-
- S:<sect_size>- sector size for RAM disk - 256 or 512 bytes, default is
- 512 bytes. Using 256 bytes sectors may sometimes save
- some space on RAM disk but this is effective only if
- RAM disk size is less than 1 Mbyte.
-
- N - tells RAM disk not to return 'sector not found' error
- (see also below). This setting may be always changed by
- control program.
-
- /C - means that cache parameters follow.
-
- <cache_parms>- cache parameters may be the following:
-
- M:<min_cache>- specifies minimum cache size (Kbytes). This reduces size
- of RAM disk but guarantees that specified amount of
- memory will be always allocated to cache. Default is 0.
-
- U:<block_sec>- number of sectors per cache block (from 1 to 8). Using
- smaller blocks may result in more effective usage of
- memory (if You have not much of it) but leads to slower
- operation for large read/write transfers. Default is 8.
-
- O - tells COMBI-disk to turn OFF disk cache after
- installation. Cache may be turned ON at any time by
- control program. This may be useful for testing period
- if You have some problems.
-
- B - enable background disk writes. By default background
- writes are set off on installation. May be changed at
- any time by control program.
-
- I - forces COMBI's disk cache to start background writing
- immediately. By default background writing starts within
- 18 timer ticks (approx. 1 sec.) after last access to hard
- disk. This is in effect only when background writing is
- enabled. I admit that sometimes it may be more safe to
- start writing immediately rather than wait a second, but
- as a rule that slows down cache performance, especially
- for large transfers.
-
- /H - tells COMBI-disk to use HMA for data tables.
-
- /Q - tells COMBI-disk not to display installation parameters.
-
- In short, recommended installation parameters for best performance are:
-
- DEVICE=<drive>:<path>COMBI.SYS 16000 16000 /V F:16000 /C B /H
-
- In this case COMBI allocates all available XMS memory but will release
- almost all when it is requested, RAM disk is created of maximum size
- and write caching is enabled. (You may use other numbers instead of 16000
- if You have less than 16 Mbytes of XMS or don't want to spend all XMS
- for COMBI.)
-
- Note: Minus ('-') may be used everywhere in command line instead of
- slash ('/'), and equal sign ('=') instead of colon (':'). Case
- of the letters is insignificant. Spaces are required only after
- COMBI.SYS name and between two adjacent numbers.
-
-
- Installation messages.
- ---------------------
-
- COMBI-Disk: RAM disk & disk cache
- Copyright (C) 1991, 1992 by Vadim V. Vlasov, Moscow, Russia,
- Version 1.10
-
- - This banner always appears and tells You that
- COMBI-disk is being installed.
-
-
- ERROR: Incorrect DOS version!
-
- - DOS version must be above or equal to 3.30 and below 6.00.
-
- ERROR: Invalid parameter!
-
- - An invalid parameter appears in command line or some
- parameter is specified in improper place.
-
- ERROR: Extended Memory Manager not present!
-
- - COMBI-Disk needs XMM driver. Check that Your XMM driver
- is installed before COMBI-Disk.
-
- ERROR: No extended memory available!
-
- - All Your extended memory is used by some other programs
- or less than 128K is available.
-
- ERROR: Can't allocate extended memory!
-
- - An error encountered when COMBI-Disk tried to allocate
- extended memory.
-
- ERROR: Not enough memory!
-
- - Not enough memory for COMBI-disk's code and data. This
- is almost impossible.
-
- ERROR: No hard drives on system(?!)
-
- - COMBI-disk can't determine presence of hard disk(s) and
- its (their) parameter(s).
-
- WARNING: Inconsistent parameters.
-
- - Some of numeric parameters conflict with each other. As
- a rule this is not fatal - some of the numbers will be
- adjusted.
-
- WARNING: Can't hook XMS driver entry chain.
-
- - COMBI-disk won't intercept XMS (re)allocation calls and
- hence automatic reallocation of COMBI's memory is
- disabled. However, You may change amount of used XMS
- memory by control program.
-
- WARNING: Not enough HMA for data tables or HMA not available.
-
- - COMBI-disk will use more low memory for its data tables.
- (For 3 Mbytes buffer it is about 10K)
-
- If "ERROR:..." message is displayed COMBI-disk aborts installation.
-
- If the installation is successful a table appears (if it is not
- disabled by /Q switch) which summarizes installation options and
- announces how much memory is used by COMBI-disk.
-
- Note. Some of numeric parameters specified in command line may be
- adjusted by COMBI-disk.
-
-
- Testing.
- -------
-
- A simple test program CMBTEST.COM is supplied with the package. It
- writes randomly to few files, deletes some of them etc. Its objective
- is to convince You that memory allocation strategy used by COMBI-disk
- is reliable. It may also be used to test write caching reliability.
-
- Usage:
- CMBTEST <dirname> [<options>]
- where <dirname> is name of directory (or drive) where CMBTEST will
- write the files - it may be a directory on a hard drive or COMBI's RAM
- disk. <options> may be used if You want to run multiple test series.
- (For more details see the source code CMBTEST.C) I suggest You to
- run
- CMBTEST <COMBI's_RAM_drive_letter>:
- and then
- CMBTEST <some_temporary_directory_on_hard_disk>
- and compare the resulted files:
- COMP <path1>*.* <path2>
- (<path1(2)> - pathnames of target directories). If all the "files
- compare O'K" then there is no error and You may delete the files or
- repeat the test with other options. Note: options must be the same for
- both runs otherwise the files will be different.
-
- You may also change the program if You have any new ideas how to
- improve the test.
-
-
- Control of operation.
- --------------------
-
- A control program COMBI.COM is supplied with the package. It allows
- You to change cache or RAM disk options or change memory setting
- without reconfiguring and rebooting. It also displays some statistic
- information which may be helpful: current options, number of read/write
- accesses to hard/RAM disk etc.
-
- Usage:
- COMBI [+/-<mem_change] [<options>...]
- where
-
- <mem_change> - amount of memory (Kbytes) to add to or release from
- COMBI-disk. If memory can't be reallocated by specified
- amount COMBI will report that.
-
- <options> - a sequence of any of letters 'i', 'o', 'b', 'z', 'f',
- 'r', 'n' which may be separated by spaces and/or
- followed by '-' which reverses the meaning of the
- option. Case of the letters is insignificant.
-
- i - turn off delayed writing (write immediately) ('i-'
- turns delayed writing on),
-
- o - turn cache on ('o-' - turn off),
-
- b - enable background writing ('b-' - disable),
-
- z - 'freeze' cache - after freezing the sectors which are
- already in cache remain there (are not purged) while
- no new sectors are copied to cache. This may be useful
- e.g. if You have small cache and want to keep there
- only FAT and directories, then You might run "CHKDSK"
- (which reads the whole FAT and all the directories)
- and then "COMBI z". 'z-' returns cache to normal
- operation.
-
- f - fix memory settings - this disables automatic
- reallocation of XMS memory to other programs.
-
- n - tells RAM disk not to return 'sector not found' error.
-
- r - resets all statistic counters (there is no 'r-'
- option).
-
- "COMBI ?" displays quick help on parameters usage.
-
- Source code COMBI.C and header file IOCTL.H are provided if You wish
- to implement some control over COMBI-disk into Your applications
-
-
- Compatibility.
- -------------
-
- COMBI-disk is compatible with:
-
- - MS-DOS versions 3.30 - 5.00 (if it were not it would be useless);
-
- - DR-DOS version 6.00 (version 5.00 was not tested);
-
- - Borland's Turbo-debugger TD386 (TD386 uses XMS memory released by
- COMBI-disk);
-
- - MS-WINDOWS;
-
- - DJGPP (GNU C++ compiler for DOS and GO32 DOS extender by
- DJDelorie), however LD (DJGPP linker) often runs into "Sector not
- found" error if some of object files are on RAM disk, usage of "N"
- installation option or "COMBI n" solves the problem;
-
- - many other programs.
-
- COMBI-disk is incompatible with:
-
- - Maybe some multitasking programs (please report me about any
- incompatibilities).
-
-
- Possible errors.
- ---------------
-
- Sector not found - You tried to read a sector which does not contain
- any valid data (You haven't written into it yet or have already
- deleted the file that occupied this sector). This never happens
- with the majority of programs. However, for some programs this
- occurs regularly. It is recommended to reply 'Ignore' to the
- 'Retry, Ignore, Fail?' DOS prompt. If You are sure that this
- causes no errors You may specify option 'N' as one of
- installation parameters (or run "COMBI n"). In this case the
- 'not found' sectors are also not read, but error status is not
- returned by COMBI-disk.
-
- Warning! Once a file is deleted from RAM disk, it might not be correctly
- unerased by any means. It's data is lost immediately.
-
- Data error writing drive <RAM_disk> - this may happen when some XMS
- memory has been loaned to a program and that program also tries
- to write some files to RAM disk which has not enough memory for
- that. Suggested action - specify less amount of memory which
- COMBI-disk should release for other programs or configure the
- program to use other drive for temporary files.
-
- The same problem may arise if a program which used XMS memory
- terminated (or has been aborted) but not released memory. In
- this case COMBI-disk can't reallocate XMS memory back to the
- full size. It continues working but won't use the full buffer
- size for cache or RAM disk data.
-
- Other errors indicate that either COMBI-Disk internal data tables
- are corrupt (e.g. overwritten by other program) or error in XMM driver
- encountered.
-
-
- Some hints.
- ----------
-
- "TEMP" environment variable is used by MS-DOS as a directory for
- temporary files, in particular when COMMAND.COM creates pipes
- (e.g. "dir | sort | more" etc.).
-
- "TMP" environment variable is used by many programs (e.g. Microsoft
- compilers) as a directory for temporary files. So, setting TEMP and TMP
- in AUTOEXEC.BAT to point to Your RAM disk may improve Your system
- performance.
-
- Many other programs also can take advantage of RAM disk - see their
- manuals and configure them.
-
- Using write caching is not very dangerous as it might seem. In fact,
- when COMBI-disk is configured for background writing it often takes
- less time to finish writing to hard disk than without write caching.
- Moreover, while data is being written to disk You program continues
- working and that saves You a lot of processor time. Enabling delayed
- writing as a rule decreases number of hard disk accesses and hard disk
- head motions. However, if You start a program that hooks INT 08 (timer)
- and does not pass control to former INT 08 handlers (some games often
- do so) it would be better if You disable delayed writes ("COMBI i")
- before starting such a program and enable it later ("COMBI i-").
-
- Freezing cache ("COMBI z") when it contains certain data may be useful
- if COMBI-disk's buffer size is relatively small. E.g. Freezing cache
- after "CHKDSK" results in faster search for a file or directory change,
- freezing cache after run of some program (whose size is less than cache
- size) results in faster loading of that program on future runs (while
- other programs operate as without cache).
-
-
- The name of the game.
- --------------------
-
- The name "COMBI" originates from "COMBInation" of such incompatible
- (maybe even contradicting) at the first sight programs: RAM disk and
- disk cache.
-
-
- History information.
- -------------------
-
- Version 1.10 (01 Dec 1992):
-
- Few bugs of version 1.00 were fixed. These include:
- - "Not enough memory" error under DOS other than MS v.5.00;
- - Very poor performance (worse than without cache) if VERIFY is set ON.
-
- Now COMBI may use HMA under DR-DOS as well.
- Performance of cache improved.
- Write delay time increased from 5 to 18 clock ticks (1 sec).
- Added Ctrl-Alt-Del handling to flush cache before reboot.
- COMBI control program renamed from "CMBCTL" (which was hardly typeable
- and hardly rememberable) to "COMBI", ANSI sequences are used to provide
- color output.
-
- Version 1.00 (08 Aug 1992):
-
- A lot of new features added compared to previous versions: write
- caching, reallocation of XMS memory, IOCtl interface to control
- operation of COMBI-disk etc. Most of the code has been completely
- rewritten. However, the main idea of dynamical memory reallocation
- between RAM disk and disk cache remained the same.
-
- Version 0.31 (15 Feb 1992):
-
- Few minor bugs of version 0.30 fixed.
- No other serious changes.
-
- Version 0.30 (08 Nov 1991):
-
- Performance of delete from RAM disk operations increased compared to
- previous versions.
-
- For certain configuration parameters (e.g. 320 /v 128 256) COMBI-Disk
- created FAT larger than really needed. However, it was O'K for DOS 5.0
- but led to errors with DOS 3.30.
- - Now it is fixed.
-
- Version 0.20 (28 Oct 1991):
-
- A bug has been discovered in version 0.10: RAM disk failed after an
- attempt to write into boot sector and one or more sectors of FAT.
- - Now it is fixed.
-
- DOS 4.0+ CHKDSK did not work with version 0.10 due to simplified
- format of boot sector of RAM disk.
- - This is now corrected for MS-DOS 5.0 but some DOS versions need
- a certain text be written into boot sector (e.g. for IBM-DOS 4.0
- it is "RDV 1.20" at offset 3 of boot sector). If You are aware
- what You are doing, You may correct this problem for Your DOS.
-
- Version 0.10 (13 Aug 1991):
-
- The very first beta version of COMBI-Disk was version 0.01 (24 Jun 1991).
- In this version (0.10) two minor bugs have been fixed:
- A. COMBI-Disk v.0.01 refused to work under DOS 3.30 - not
- just it couldn't but only refused.
- B. Device return codes were corrected.
- No any serious bugs were discovered yet.
-
-
- Future.
- ------
-
- Here are some of my ideas about future developement of COMBI:
-
- - Caching of floppy disks;
-
- - Special version for 80386 processor (probably, usage of 80386
- instructions may increase performance);
-
- - Reallocation of XMS memory allocated to other programs is not
- currently supported (some of programs allocate XMS and then reallocate
- it to larger size) - that will be certanly done;
-
- - As regards usage of EMS instead of XMS, I'm not sure that it would be
- an advantage. However, if there is enough interest in that I'll implement
- EMS support;
-
- - Further improvement of performance.
-
-
- ----------------
- If You have any questions, comments or find out any problems with
- COMBI-disk usage please contact:
-
- Vadim V. Vlasov,
- Inst. for Nuclear Research of Russian Acad. Sci.,
- 60th October Anniversary prospect, 7a,
- 117312, Moscow, Russia.
-
- phone: 7-095-133-6533
-
- Internet: vvlasov@inucres.msk.su
-
-
-